<template>
  <div class="root">
    <!-- 路由组件 -->
    <router-view v-slot="{ Component }" class="router-view">
      <transition
        enter-active-class="animate__animated animate__fadeIn"
        leave-active-class="animate__animated animate__fadeOut"
      >
        <component :is="Component" class="component" />
      </transition>
    </router-view>
  </div>
</template>

<script setup lang="ts">
import { useResizeM } from '@/m/useResize'
const { resizeFontSize } = useResizeM()

onMounted(() => {
  // 监听窗口大小，调整字体
  resizeFontSize(14)
})
</script>

<style scoped lang="scss">
.root {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  font-size: 20px;
  display: grid;
}

.animate__animated {
  animation-duration: 0.25s !important;
}

.router-view {
  position: relative;
  height: calc(100vh - 2rem);
}

.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}

.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}

.logo.vue:hover {
  filter: drop-shadow(0 0 2em #42b883aa);
}
</style>
